package top.infopub.mgr.common.tags;


import java.io.IOException;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.TagSupport;

import org.apache.commons.lang3.StringUtils;

import top.infopub.mgr.util.SysParaUtil;


public class LabelTag extends TagSupport {

    private static final long serialVersionUID = -7810428295934419948L;

    /* 数据字典编号 */
    private String groupNo;

    /* true or false */
    private String entire;

    private String dataStr = "";

    @Override
    public int doStartTag()
        throws JspException {
        try {
            if (StringUtils.isBlank(entire)) {
                entire = "false";
            }
            if (StringUtils.isNotBlank(dataStr)) {
                entire = "true";
            }
            pageContext.getOut().write(SysParaUtil.getGrpParamStr(groupNo, entire, dataStr));
        }
        catch (IOException e) {
            e.printStackTrace();
        }
        return super.doStartTag();
    }

    @Override
    public int doEndTag()
        throws JspException {
        return super.doEndTag();
    }

    @Override
    public void release() {
        super.release();
        groupNo = "";
        entire = "";
        dataStr = "";
    }

    public String getGroupNo() {
        return groupNo;
    }

    public void setGroupNo(String groupNo) {
        this.groupNo = groupNo;
    }

    public String getEntire() {
        return entire;
    }

    public void setEntire(String entire) {
        this.entire = entire;
    }

    public String getDataStr() {
        return dataStr;
    }

    public void setDataStr(String dataStr) {
        this.dataStr = dataStr;
    }

}
